package factory

import (
	"apibe/single/src/v1/share/db"
	"context"
	"go.mongodb.org/mongo-driver/bson"
)

// 刷新 DesignList
func reloadDesignList() {
	_designList := DesignList
	cursor, err := db.GetMongoCollection(db.CollectionDesign).Find(context.Background(), bson.M{})
	if err != nil {
		return
	}
	err = cursor.All(context.Background(), &DesignList)
	if err != nil {
		DesignList = _designList
	}
}
